Feature: Quote page - Get Quotes

  @happy
  Scenario: Request Contains Primary and Child and Spouse - System return detail plan info
    When I send a POST request to Quote API "quote/ifp"
      """
      {
      "zipCode": "98001",
      "county": "KING",         
      "forcedOep": false,
      "allianceId": "Gro21010",
      "members": {
      "primary": {
      "gender": "Female",
      "birthday": "01/02/1980",
      "smoker": false,
      "student": false
      },
      "secondary": {
      "gender": "male",
      "birthday": "01/02/1980",
      "smoker": false,
      "student": false
      },
      "children": [{
      "gender": "MALE",
      "birthday": "01/02/2000",
      "smoker": false,
      "student": false
      }
      ]
      }
      }
      """
    Then the response status should be 200
    #And the plan number of alliance "Gro21010", state "WA", product "IFP" is correct
    And the range filter is correct
    And the Deductible of the plans are correct
    And the Office Visit of the plans are correct
    And the monthly cost of the plans are correct

  @happy
  Scenario: Request Contains Primary only - System return detail plan info
    When I send a POST request to Quote API "quote/ifp"
      """
      {
      "zipCode": "98001",
      "county": "KING",
      "forcedOep": false,
      "allianceId": "Gro21010",
      "members": {
      "primary": {
      "gender": "Female",
      "birthday": "01/02/1980",
      "smoker": false,
      "student": false
      }
      }
      }
      """
    Then the response status should be 200
    #And the plan number of alliance "Gro21010", state "WA", product "IFP" is correct
    And the range filter is correct
    And the Deductible of the plans are correct
    And the Office Visit of the plans are correct
    And the monthly cost of the plans are correct

  @happy
  Scenario: Request Contains Primary and Spouse - System return detail plan info
    When I send a POST request to Quote API "quote/ifp"
      """
      {
      "zipCode": "98001",
      "county": "KING",
      "forcedOep": false,
      "allianceId": "Gro21010",
      "members": {
      "primary": {
      "gender": "Female",
      "birthday": "01/02/1980",
      "smoker": false,
      "student": false
      },
      "secondary": {
      "gender": "male",
      "birthday": "01/02/1980",
      "smoker": false,
      "student": false
      }
      }
      }
      """
    Then the response status should be 200
    #And the plan number of alliance "Gro21010", state "WA", product "IFP" is correct
    And the range filter is correct
    And the Deductible of the plans are correct
    And the Office Visit of the plans are correct
    And the monthly cost of the plans are correct

  @happy
  Scenario: Request Contains Primary and Spouse and five children- System return detail plan info
    When I send a POST request to Quote API "quote/ifp"
      """
      {
      "zipCode": "98001",
      "county": "KING",
      "forcedOep": false,
      "allianceId": "Gro21010",
      "members": {
      "primary": {
      "gender": "Female",
      "birthday": "01/02/1980",
      "smoker": false,
      "student": false
      },
      "secondary": {
      "gender": "male",
      "birthday": "01/02/1980",
      "smoker": false,
      "student": false
      },
      "children": [{
      "gender": "MALE",
      "birthday": "01/02/2000",
      "smoker": false,
      "student": false
      },
      {
      "gender": "MALE",
      "birthday": "01/02/2000",
      "smoker": false,
      "student": false
      },
      {
      "gender": "MALE",
      "birthday": "01/02/2000",
      "smoker": false,
      "student": false
      },
      {
      "gender": "MALE",
      "birthday": "01/02/2000",
      "smoker": false,
      "student": false
      },
      {
      "gender": "MALE",
      "birthday": "01/02/2000",
      "smoker": false,
      "student": false
      }
      ]
      }
      }
      """
    Then the response status should be 200
    #And the plan number of alliance "Gro21010", state "WA", product "IFP" is correct
    And the range filter is correct
    And the Deductible of the plans are correct
    And the Office Visit of the plans are correct
    And the monthly cost of the plans are correct

  @happy
  Scenario: Get Quotes during OEP - System return the detail plan info
    When I send a POST request to "quote/ifp"
      """
      {
      "zipCode": "98001",
      "county": "",
      "requestEffectiveDate": "07/09/2016",
      "qualifyingLifeEvent": null,
      "dateOfEvent": null,
      "forcedOep": true,
      "allianceId": "Gro21010",
      "members": {
      "primary": {
      "gender": "Female",
      "birthday": "01/02/1980",
      "smoker": false,
      "student": false
      }
      }
      }
      """
    Then the response status should be 200
    #And the plan number of alliance "Gro21010", state "WA", product "IFP" is correct
    And the range filter is correct
    And the Deductible of the plans are correct
    And the Office Visit of the plans are correct
    And the monthly cost of the plans are correct

  @happy
  Scenario: Update zipCode and allianceId - The response should be updated accordingly
    When I send a POST request to Quote API "quote/ifp"
      """
      {
      "zipCode": "97001",
      "county": "",
      "forcedOep": false,
      "allianceId": "Pac26719",
      "members": {
      "primary": {
      "gender": "Female",
      "birthday": "01/02/1980",
      "smoker": true,
      "student": false
      }
      }
      }
      """
    Then the response status should be 200
    ##And the plan number of alliance "Pac26719", state "OR", product "IFP" is correct
    And the range filter is correct
    And the Deductible of the plans are correct
    And the Office Visit of the plans are correct
    And the monthly cost of the plans are correct

  @happy
  Scenario: Update Smoker - The response should be updated accordingly
    When I send a POST request to Quote API "quote/ifp"
      """
      {
      "zipCode": "98001",
      "county": "KING",
      "forcedOep": false,
      "allianceId": "Gro21010",
      "members": {
      "primary": {
      "gender": "Female",
      "birthday": "01/02/1980",
      "smoker": true,
      "student": false
      }
      }
      }
      """
    Then the response status should be 200
    #And the plan number of alliance "Gro21010", state "WA", product "IFP" is correct
    And the range filter is correct
    And the Deductible of the plans are correct
    And the Office Visit of the plans are correct
    And the monthly cost of the plans are correct

  @happy
  Scenario Outline: Update QLE and date - The response should be updated accordingly
    When I send a POST request to Quote API "quote/ifp"
      """
      {
      "zipCode": "98001",
      "county": "KING",
      "qualifyingLifeEvent": "<qualifyingLifeEvent>",
      "forcedOep": false,
      "allianceId": "Gro21010",
      "members": {
      "primary": {
      "gender": "Female",
      "birthday": "01/02/1980",
      "smoker": true,
      "student": false
      }
      }
      }
      """
    Then the response status should be 200
    #And the plan number of alliance "Gro21010", state "WA", product "IFP" is correct
    And the range filter is correct
    And the Deductible of the plans are correct
    And the Office Visit of the plans are correct
    And the monthly cost of the plans are correct
    And the effective date returned is correct

    Examples: QLE event can be lossing coverage,marriage,move to another area,birth,other
      | qualifyingLifeEvent        |
      | loss_of_coverage           |
      | got_married_or_divorced    |
      | moved_to_a_different_state |
      | had_a_baby                 |

  @happy
  Scenario Outline: Update QLE and date - The response should be updated accordingly
    When I send a POST request to "quote/ifp"
      """
      {
      "zipCode": "98001",
      "county": "KING",
      "requestEffectiveDate":"07/01/2016",
      "qualifyingLifeEvent": "<qualifyingLifeEvent>",
      "dateOfEvent": null,
      "forcedOep": false,
      "allianceId": "Gro21010",
      "members": {
      "primary": {
      "gender": "Female",
      "birthday": "01/02/1980",
      "smoker": true,
      "student": false
      }
      }
      }
      """
    Then the response status should be 200
    #And the plan number of alliance "Gro21010", state "WA", product "IFP" is correct
    And the range filter is correct
    And the Deductible of the plans are correct
    And the Office Visit of the plans are correct
    And the monthly cost of the plans are correct
    And the effective date returned is correct

    Examples: QLE event can be lossing coverage,marriage,move to another area,birth,other
      | qualifyingLifeEvent |
      | i_dont_qualify      |
      | Other               |

  @happy
  Scenario: Update Applicant info - The response should be updated accordingly
    When I send a POST request to Quote API "quote/ifp"
      """
      {
      "zipCode": "98001",
      "county": "KING",
      "forcedOep": false,
      "allianceId": "Gro21010",
      "members": {
      "primary": {
      "gender": "Male",
      "birthday": "01/02/2000",
      "smoker": false,
      "student": false
      }
      }
      }
      """
    Then the response status should be 200
    #And the plan number of alliance "Gro21010", state "WA", product "IFP" is correct
    And the range filter is correct
    And the Deductible of the plans are correct
    And the Office Visit of the plans are correct
    And the monthly cost of the plans are correct

  @sad
  Scenario: No Plans being searched - The response should be updated accordingly
    When I send a POST request to "quote/ifp"
      """
      {
      "zipCode": "98001",
      "county": "KING",
      "requestEffectiveDate": "08/01/2016",
      "qualifyingLifeEvent": "LOSS_OF_COVERAGE",
      "dateOfEvent": "06/01/2016",
      "forcedOep": false,
      "allianceId": "Gro21010",
      "members": {
      "primary": {
      "gender": "Female",
      "birthday": "01/02/2000",
      "smoker": false,
      "student": false
      }
      }
      }
      """
    Then the response status should be 400
    And the error message should be "SEP_INELIGIBLE"
